package com.cy.lib.redis.demo.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.cy.lib.redis.demo.domain.User;
import com.cy.lib.redis.demo.service.UserService;

@Controller
public class UserController {

	@Autowired
	private UserService userService;

	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	
	public User saveUser(User user){
		return userService.saveUser(user);
	}
	
	public User findById(long id){
		return userService.findById(id);
	}
	
	public List<User> findByName(String name){
		return userService.findByName(name);
	}
	
	public List<User> findAll(){
		return userService.findAll();
	}
	
	public User updateUser(User user){
		return userService.updateUser(user);
	}
	
	public void deleteUser(User user){
		userService.deleteUser(user);
	}
}
